#include "syscall.h"

int main()
{
	int myLock, myCV, rv;
	PrintString("Starting clientBroadcastTest Now...\n", sizeof("Starting clientBroadcastTest Now...\n"));
	StartClient();
	
	PrintString("Creating myLock now.\n", sizeof("Creating myLock now.\n"));
	myLock = CreateLock("TestLock", 8);
	Print("Created myLock with the ID [%d].\n", sizeof("Created myLock with the ID [%d].\n"), myLock*1000, -1);
	
	PrintString("Creating myCV now.\n", sizeof("Creating myCV now.\n"));
	myCV = CreateCondition("TestCV", 6);
	Print("Created myCV with the ID [%d].\n", sizeof("Created myCV with the ID [%d].\n"), myCV * 1000, -1);
	
	PrintString("Now Acquiring myLock.\n", sizeof("Now Acquiring myLock.\n"));
	rv = AcquireLock(myLock);
	Print("Lock acquired, acquire returned the rv [%d].\n", sizeof("Lock acquired, acquire returned the rv [%d].\n"), rv*1000, -1);
	
	PrintString("Broadcasting on cv now.\n", sizeof("Broadcasting on cv now.\n"));
	BroadcastCondition(myCV, myLock);
	PrintString("Broadcasted the cv.\n", sizeof("Broadcasted the cv.\n"));
	
	PrintString("Releasing lock now.\n", sizeof("Releasing lock now.\n"));
	ReleaseLock(myLock);
	PrintString("Lock released.\n", sizeof("Lock released.\n"));
	
	PrintString("Exiting clientBroadcastTest.\n", sizeof("Exiting clientBroadcastTest.\n"));
	
	Exit(1);
	return 1;
}